﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Mail;
using System.Net;


namespace BusinessLogicLayer
{
    public class EmailNotificationControl
    {
        

        public void sendNotification(string toemail, string fromemail, string body, string subject)
        {
            try
            {
                MailMessage mailMessage = new MailMessage(fromemail,toemail);
                //mailMessage.From = new MailAddress(fromemail); 

                mailMessage.Subject = subject;
                mailMessage.Body = body;

                SmtpClient smtpClient = new SmtpClient("lynx.iss.nus.edu.sg");
                smtpClient.Send(mailMessage);
                smtpClient.Dispose();



            }
            catch (Exception ex)
            {
               
            }
        }
    }
}
